Skip to content

Conversation

@WojciechMazur
Copy link
Contributor

@WojciechMazur WojciechMazur commented Nov 23, 2025

This changes can be used as best effort mitigation of underlying issues allowing for produce javadoc for scala-library required when publishing artifacts to Sonatype, however I don't believe it's a final solution of underlying issues. Some types seem not be rendered correctly, see details below

image

edit

Actually it seems to not be related to this change, similar problems are visible when using scaladoc/generateScalaDocumentation (the non-bootstrapped variant)

image

Created a dedicated issue #24511

Depends on #24433 changes, rebase required before merge

During scaladoc generation with --from-tasty, the compiler reads TASTY files in Mode.ReadPositions. Symbols may be incomplete, phases may not be set up, and some validation checks run that shouldn't during TASTY reading. This caused crashes and false errors.

Error 1: Assertion failure in base class computation

java.lang.AssertionError: assertion failed: class Tuple2 has non-class parent: TypeRef(TermRef(TermRef(NoPrefix,object _root_),object scala),Serializable)
    at dotty.tools.dotc.core.SymDenotations$ClassDenotation.traverse$1(SymDenotations.scala:2056)
    at dotty.tools.dotc.core.SymDenotations$ClassDenotation.computeBaseData(SymDenotations.scala:2061)
    ...
    at dotty.tools.dotc.fromtasty.ReadTasty.addTasty(ReadTasty.scala:33)

Error 2: Assertion failure in TreeInfo.sliceTopLevel

java.lang.AssertionError: assertion failed
    at dotty.tools.dotc.ast.TypedTreeInfo.sliceTopLevel(TreeInfo.scala:1015)
    at dotty.tools.dotc.transform.SetRootTree$$anon$1.traverse(SetRootTree.scala:33)
    ...
    at dotty.tools.dotc.typer.Namer.lateTypeCheck$1(Namer.scala:772)

Error 3: Assertion failure in implicit search

java.lang.AssertionError: assertion failed: missing implicit parameter of type G[From] after typer at phase <no phase>
    at dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:1103)
    ...
    at dotty.tools.dotc.typer.Namer.lateTypeCheck$1(Namer.scala:770)

Error 4-6: False validation errors (only during --from-tasty)

  • Capture checking: scala.caps.cap.type cannot be tracked since it is not a parameter or local value
  • Naming conflicts: class consume cannot have the same name as class consume in object internal
  • TargetName clashes: @targetName annotation "" clashes with other definition in same scope

Enable `packageDoc / publishArtifact` for bootstrapped projects - javadoc is required by Sonatype validation
@Gedochao
Copy link
Contributor

Just to keep things linked, this is an attempt at working around #24434 (correct me if I'm wrong)

@WojciechMazur
Copy link
Contributor Author

Just to keep things linked, this is an attempt at working around #24434 (correct me if I'm wrong)

Yes, however it was mostly based on LLM outputs, so I would not trust this change at any level (regardless if it passes tests or not)

@WojciechMazur WojciechMazur deleted the fix/scala-library-doc branch November 28, 2025 11:43
hamzaremmal added a commit that referenced this pull request Nov 28, 2025
Based on @bracevac remarks here
#24434 (comment)

We do not need to add `-sourcepath` when generating the scaladoc since
compiling with `-from-tasty` (what scaladoc does) will put the TASTy in
the classpath. This means that the compiler will be happy and will find
the symbols.

Closes #24434
Supersedes #24569, #24510.

Thanks Oliver for taking the time to analyze the issue in depth.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants